package com.ruoyi.param.service.impl;

import com.ruoyi.param.domain.TparamUe;
import com.ruoyi.param.mapper.TparamUeMapper;
import com.ruoyi.param.service.ITparamUeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ITparamUeServiceImpl implements ITparamUeService {

    @Autowired
    private TparamUeMapper tparamUeMapper;

    @Autowired
    private ThreadPoolTaskExecutor threadPoolTaskExecutor;

    @Override
    public List<TparamUe> selectUeList(TparamUe record) {
        return tparamUeMapper.selectUeList(record);
    }

    @Override
    public void updateByRoomIdSelective(TparamUe record) {
        threadPoolTaskExecutor.execute(() -> tparamUeMapper.updateByRoomIdSelective(record));
    }

    @Override
    public void insertSelective(TparamUe record) {
        tparamUeMapper.insertSelective(record);
    }

    @Override
    public void deleteByRoomIds(List<String> roomIds) {
        tparamUeMapper.deleteByRoomIds(roomIds);
    }

    @Override
    public void refresh(List<TparamUe> records) {
        if (!records.isEmpty()) {
            tparamUeMapper.refresh(records);
        }
    }
}
